# Maintainer: Ryuta Suzuki <oroppas@gmail.com>

_realname=pptx
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.6.18
pkgrel=1
pkgdesc="Create Open XML PowerPoint documents in Python (mingw-w64)"
url="https://github.com/scanny/python-pptx"
arch=('any')
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python-lxml>=3.1.0"
         "${MINGW_PACKAGE_PREFIX}-python-pillow>=2.6.1"
         "${MINGW_PACKAGE_PREFIX}-python-xlsxwriter>=0.5.7")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-mock"
              "${MINGW_PACKAGE_PREFIX}-python-pyparsing>=2.0.1"
              "${MINGW_PACKAGE_PREFIX}-python-pytest")
source=(${_realname}-${pkgver}.tar.gz::"https://github.com/scanny/python-pptx/archive/v${pkgver}.tar.gz")
sha256sums=('f427728c4f5f3a0d28f8d1fb6d2f8c56fe133acf1161cd16083c294e10071bc0')

build() {
  cd "${srcdir}/python-pptx-${pkgver}"
  ${MINGW_PREFIX}/bin/python setup.py build
}

package() {
  cd "${srcdir}/python-pptx-${pkgver}"

  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py install --root=${pkgdir} --prefix=${MINGW_PREFIX} --optimize=1 --skip-build

  install -Dm644 LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE
}
